#@adminLayout()

#define content()
<div class="am-cf am-padding am-padding-bottom-0">
  <div class="am-fl am-cf">
    <strong class="am-text-primary am-text-lg">补充供应商品番</strong>
  </div>
</div>
<hr>
<form action="/admin/image/savePcode" id="pcodeForm" class="am-form" method="post">
  <input type="hidden" name="id" value="#(image.id)">
  <div class="am-tab-panel am-fade am-in am-active">
    <div class="am-g am-margin-top">
      <div class="am-u-sm-4 am-u-md-2 am-text-right">TFDACC品番</div>
      <div class="am-u-sm-8 am-u-md-10">
        <input type="text" name="code" id="code" value="#(image.code)" readonly style="width:400px;">
      </div>
    </div>
    <div class="am-g am-margin-top">
      <div class="am-u-sm-4 am-u-md-2 am-text-right">供应商品番样例</div>
      <div class="am-u-sm-8 am-u-md-10">
        <input type="text" name="pcode" id="pcode" style="width:400px;">
        <span class="am-text-default am-text-sm">请扫描供应商品番&nbsp;</span><span class="am-text-danger am-text-sm">(如当前供应商无品番,保留为空)</span>
      </div>
    </div>
    <div class="am-g am-margin-top">
      <div class="am-u-sm-4 am-u-md-2 am-text-right">
      </div>
      <div class="am-u-sm-8 am-u-md-10">
        <div class="am-margin">
          <button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="submitForm();">&nbsp;提交保存&nbsp;</button>
        </div>
      </div>
    </div>
  </div>
</form>

<script>
function submitForm() {
  var pcode = $("#pcode").val();
  if(pcode == '') {
    alert("必须填写供应商品番");
    return;
  }
  $("#pcodeForm").submit();
}
</script>

#end